package cn.varton.jdk;

import java.util.Observable;
import java.util.Observer;

public class MouseObserver implements Observer {
    private Observable observable;

    public MouseObserver(Observable observable) {
        this.observable = observable;
        observable.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(o.getClass());
        System.out.println("这是鼠标被单击时触发的逻辑。。。");
    }
}
